<template>
  <div class="app-container">
    <el-card>
      <el-tabs v-model="activeTab">
        <el-tab-pane label="网站信息" name="site-info">
          <site-info :siteInfo="siteInfo" />
        </el-tab-pane>
        <el-tab-pane label="功能配置" name="site-config">
          <site-config :siteInfo="siteInfo" />
        </el-tab-pane>
      </el-tabs>
    </el-card>
  </div>
</template>

<script>
import { siteLoad } from '@/api/system/config'
import SiteInfo from './components/SiteInfo'
import SiteConfig from './components/SiteConfig'

export default {
  components: {
    SiteInfo,
    SiteConfig
  },
  data() {
    return {
      activeTab: 'site-info',
      siteInfo: {}
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      siteLoad().then(response => {
        this.siteInfo = response.param
      }).catch(() => {})
    }
  }
}
</script>
